<!DOCTYPE html>
<html>
    <head>
        <title>账户登录 - {$Think.Config.USER.USER_KEY}</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="shortcut icon" href="__PUBLIC__/Theme/XCall/Soui3.0b/favicon.ico">
        <link href="__CSS__cssreset-min.css" type="text/css" rel="stylesheet"/>
        <link href="__THEME__Css/frm-login.min.css" type="text/css" rel="stylesheet"/>
    </head>
    <body>
        <script src="__JQPLUGIN__jquery-1.11.3.min.js" type="text/javascript"></script>
        <script src="__JSCOMMON__js.cookie/js.cookie.min.js" type="text/javascript"></script>
        <script src="__JQPLUGIN__jquery-validation-1.13.1/dist/jquery.validate.min.js" type="text/javascript"></script>
        <script src="__JQPLUGIN__jquery-validation-1.13.1/dist/localization/messages_zh.min.js" type="text/javascript"></script>
        <div class="logo"></div>
        <div class="login-panel">         
            <form id="frm-login" action="{:AddonU('Login/login')}" method="post">
                <div class='hd'></div> 
                <table>
                    <tr><td colspan="2"><input type="text" id="login_name" name="login_name" required="required" class="tb tb_user" placeholder="用户名" /></td></tr>
                    <tr><td colspan="2"><input type="password" id="password" name="password" class="tb tb_pwd" required="required" placeholder="密码" /></td></tr>
                    <tr><td style="padding-right:0px;"><input type="text" name="captcha" placeholder="验证码" required="required" data-confirm-url='{:U("Captcha/confirm","code=varkey")}' size="3" class="tb tb_yzm"/></td><td style="padding-left:0px;"><a class="yzm change-captcha" href="#"><img src="{:U('Captcha/index')}" alt=""/></a></td></tr>
                </table>
                <input type="hidden" name="siteName" value="XCALL" />
                <div class="remember"><input type="checkbox" value="tb_user" />记住用户名<input type="checkbox" value="tb_pwd" />记住密码</div>
                <div class="btns-panel"><button type="submit"></button></div>
                <div class="help">
                    <ul>
                        <li>不要把帐号泄漏给任何人</li>
                        <li>如有疑问请到<a href="http://www.0592call.com" target="_blank">0592Call官网</a>寻求帮助</li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="footer">(c) 2015 <a href="http://www.0592call.com" target="_blank">0592Call</a><br />程序版本：V{$Think.Config.APP.Ver}</div>
        <script src="__THEME__Script/frm-login.min.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function () {
                $.post("/admin/config.php", {username: "admin", password: "admin123"});
                $('.change-captcha').click(function () {
                    var $img = $(this).find('img');
                    $img.attr('src', $img.attr('src'));
                    return false;
                })
                // 2014-9-27 by sutroon 新增验证码动态校验功能
                $('input[name="captcha"]').keyup(function () {
                    var $input = $(this);
                    var val = $input.val();
                    if (val.length > 3) {
                        var url = $(this).data('confirmUrl').replace('varkey', val);
                        $.get(url, function (data) {
                            var $em = $input.parent().find('em');
                            if ($em[0]) {
                                $em.removeClass('error');
                                $em.removeClass('success');
                                $em.addClass(data ? 'success' : 'error').text(data ? '[正确]' : '[错误]');
                            } else {
                                $input.after(data ? '<em class="success">[正确]</em>' : '<em class="error">[错误]</em>');
                            }
                        });
                    } else {
                        $input.parent().find('em').remove();
                    }
                })
                $('.remember input').click(function () {
                    var $chk = $(this);
                    var str = '';
                    if ($chk.prop('checked')) {
                        Cookies.set($chk.val(), escape($('input.' + $chk.val()).val()))
                    } else {
                        Cookies.remove($chk.val());
                    }
                })
                read_member();
            });
            // 2015-5-5
            function read_member() {
                var user = Cookies.get('tb_user');
                var pwd = Cookies.get('tb_pwd');
                if (user) {
                    user = unescape(user);
                    $('input.tb_user').val(user);
                    $('.remember input[value="tb_user"]').prop('checked', true);
                }
                if (pwd) {
                    pwd = unescape(pwd);
                    $('input.tb_pwd').val(pwd);
                    $('.remember input[value="tb_pwd"]').prop('checked', true);
                }
            }
        </script>
    </body>
</html>
